import JSEncrypt from './jsencrypt.js'
// 加密


function des_encrypt(message) {
	let encryptor = new JSEncrypt() // 新建JSEncrypt对象

	let publicKey =
		`-----BEGIN PUBLIC KEY-----
		MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCU9k8s7s5SxtnzOcCY5WvlKM9k
		sGiMcdyN0Y7OlJ8YVMoOwitrhXPRLL/hqpA3fz78GEzAm6bC2jhK4hmP9h9jdv75
		fIXjRZPVJuVWAjjDUjoJ89qEp34/HJWtwK629Dcci9tqgPVO2wiNV+anRqpu2uAA
		+9Bl+gDP4b2qjDYKOwIDAQAB
		-----END PUBLIC KEY-----` //把之前生成的贴进来，实际开发过程中，可以是后台传过来的

	encryptor.setPublicKey(publicKey) // 设置公钥

	let rsaPassWord = encryptor.encrypt(message) // 对需要加密的数据进行加密
	return rsaPassWord

}
module.exports = {
	des_encrypt: des_encrypt
}
